package com.eastcom.providor.dao.impl;

import java.util.List;
import com.eastcom.bm.atom.Atom_MsgSub;
import com.eastcom.providor.dao.BaseDao;
import com.eastcom.providor.dao.IMsgSubDao;

public class MsgSubDao extends BaseDao implements IMsgSubDao {

	public List<Atom_MsgSub> selectAllMsgSub(int type) throws Exception {
		List<Atom_MsgSub> results=null;
		try {
			String hql="from Atom_MsgSub where subType=?";
			results=this.getObjects(hql, new Object[]{type});
		} catch (Exception e) {
			throw e;
		}
		return results;
	}

	public void addMsgSubDao(Atom_MsgSub msgSub) throws Exception{
		try {
			this.saveObject(msgSub);
		} catch (Exception e) {
			throw e;
		}
	}

	public void deleteMsgSubDao(List<String> ids) throws Exception{
		try {
			for(String id:ids){
				this.deleteObject(Atom_MsgSub.class, id);
			}
		} catch (Exception e) {
			throw e;
		}
	}

	public void update(Atom_MsgSub sub) throws Exception {
		this.updateObject(sub);
	}
}
